package com.yzh.luckydraw.infrastructure.dao;

import com.yzh.luckydraw.domain.activity.model.req.ActivityInfoLimitPageReq;
import com.yzh.luckydraw.domain.activity.model.vo.ActivityPartakeRecordVO;
import com.yzh.luckydraw.domain.activity.model.vo.AlterStateVO;
import com.yzh.luckydraw.infrastructure.po.Activity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface IActivityDao {
    /**
     * 插入活动数据
     * @param activity
     */
    void insert(Activity activity);

    /**
     * 根据活动ID查询活动信息
     * @param activityId
     * @return
     */
    Activity queryActivityById(Long activityId);

    /**
     * 变更活动状态
     * @param alterStateVO
     * @return
     */
    int alterState(AlterStateVO alterStateVO);

    /**
     * 扣减活动库存
     * @param activityId
     * @return
     */
    int subtractionActivityStock(Long activityId);

    /**
     * 扫描待处理的活动列表，状态为：通过、活动中
     * @param id
     * @return
     */
    List<Activity> scanToDoActivityList(Long id);

    /**
     * 更新用户领取活动后，活动库存
     * @param activity
     */
    void updateActivityStock(Activity activity);

    /**
     * 查询活动数量
     * @param req
     * @return
     */
    Long queryActivityInfoCount(ActivityInfoLimitPageReq req);

    List<Activity> queryActivityInfoList(ActivityInfoLimitPageReq req);
}
